package com.hdaccp.ch06

import org.apache.spark.{SparkConf, SparkContext}

object Demo1 {
  def main(args: Array[String]): Unit = {
    var id = ""
    var qtype = ""
    val sparkConf = new SparkConf().setMaster("local[2]").setAppName("ch06Demo1App")

    val sparkContext = new SparkContext(sparkConf)

    val rdd = sparkContext.textFile("F:/accp教学/sparkresources/log1") ;

    //数据清洗
   /* rdd.map(x=>x.split("\t")).map(y=>{
      id = y(0)
      var a = y(2)
      qtype =  a.substring(a.indexOf("/"),1)
      QiYiLog(id,qtype)
    }).foreach(println) ;*/


  }


}

case class QiYiLog(ip:String,qiyitype:String)
